<?php

namespace app\index\service;

use app\index\dao\ConsultingServerDao;
use app\index\model\UM as UM;
use think\Collection;

/**
 * Class QuickConsultingServerService
 * @package app\index\service
 */
class QuickConsultingServerService
{
    // dao
    private ConsultingServerDao $consultingServerDao;

    public function __construct(ConsultingServerDao $consultingServerDao)
    {
        $this->consultingServerDao = $consultingServerDao;
    }

    /**
     * 列表
     * @param UM|null $user
     * @param int|null $page
     * @param int|null $page_size
     * @return Collection
     */
    public function index(?UM $user, $type, ?int $page = null, ?int $page_size = null): Collection
    {
        return $this->consultingServerDao->selectQuickConsultingServer($page, $page_size);
    }

    public function read($id, $serverType){


        return $this->consultingServerDao->findConsultingServerByServerType($id, $serverType);
    }
}
